package test;

import java.io.BufferedReader;
import java.io.IOException;

public class LoadTestClientTCPListener extends Thread {
    private LoadTestClient client;
    private BufferedReader reader;
    private boolean running = true;
    
    
    public LoadTestClientTCPListener(LoadTestClient cl, BufferedReader reader) {
        super();
        this.client = cl;
        this.reader = reader;
    }



    @Override
    public void run() {
        String s;
       try {
        while (running && (s=reader.readLine())!=null){
               client.addToQueue(s);
           }
        } catch (IOException e) {
            System.out.println("ERROR: "+e.getMessage());
        }finally{
            try {
                reader.close();
            } catch (IOException e) {
                System.out.println("ERROR: "+e.getMessage());
            }
        }
        
        
    }

    
}
